package com.da.javatest.util;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * @author chenlida
 * @date 2019/12/18 15:29
 * @description
 */
public class FileUtil {
    public static void main(String[] args) throws IOException {

        FileInputStream inputStream = new FileInputStream("d://a.txt");
        //设置inputStreamReader的构造方法并创建对象设置编码方式为gbk
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream, "utf-8"));

        String str = null;
        while ((str = bufferedReader.readLine()) != null) {
            if (str.contains("品仓商记录为空")) {
                System.out.println(str);
            }
        }

        //close
        inputStream.close();
        bufferedReader.close();

    }
}
